<%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 2022/11/30
  Time: 21:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path=request.getContextPath();%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form id="UpdateRole" class="form-horizontal" role="form">
    <input type="hidden"  name="rid" value="${role.rid}" id="rid">
    <div class="form-group" >
        <label for="rname" class="col-sm-2 control-label">角色名称</label>
        <div class="col-sm-2">
            <input type="text" class="form-control" id="rname" placeholder="请输入角色名称" name="rname" value="${role.rname}">
        </div>
    </div>
    <div class="form-group" >
        <label class="col-sm-2 control-label">选择角色的权限</label>
        <div class="col-sm-2">
            <ul id="treeDemo" class="ztree"></ul>
        </div>
    </div>
</form>
<script>
    var setting = {
        async:{
            enable:true,
            url:"<%=path%>/Menu/getAllRoleMenu?rid="+$("#rid").val()
        },check:{
            enable:true
        }
    };
    $(function(){
        $.fn.zTree.init($("#treeDemo"), setting);
    });
</script>
</body>
</html>
